home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Cookie
/
remove-ads.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
6KB
|
245 lines
<!NOWIZARD>
<!TITLE>Remove Ads
<!/TITLE>
<!DESCRIPTION>Catches all clicks on ads and writes a cookie on the visitor's computer. Until the cookie expires, no ads are shown. <!/DESCRIPTION>
<!CATEGORY>cookies<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL REMOVE ADS:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Adremover (adremover@portalen.no) -->
<!-- Web Site: http://adremover.vr9.com/ -->
<!-- Begin
// NB! You must manually change the value
// of the following adlink variable!
//
// Unique part of the ad link(s), i.e.,
// if the ad-link is www.myadvertiser.com,
// you can use "myadvertiser":
//
var adlink="change this text!";
//
// Time in seconds until the ads come back
// (default 24 hours):
//
var timeout=60*60*24;
// Do not change anything in the code below:
var showads = 1;
function adMessage(adcode) {
if (document.cookie == "") {
document.write(adcode);
} else {
var the_cookie = document.cookie;
the_cookie = unescape(the_cookie);
the_cookie_split = the_cookie.split(";");
for (loop=0;loop<the_cookie_split.length;loop++) {
var part_of_split = the_cookie_split[loop];
var find_name = part_of_split.indexOf("ad");
if (find_name!=-1) {
break;
}
}
if (find_name==-1) {
document.write(adcode);
} else {
var ad_split = part_of_split.split("=");
var last = ad_split[1];
if (last!=0) {
document.write(adcode);
} else {
showads=0;
}
}
}
}
function writeCookie(show) {
var today = new Date();
var the_date = new Date();
the_date.setTime(today.getTime() + 1000 * timeout);
var the_cookie_date = the_date.toGMTString();
var the_cookie = "ad="+show;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie = the_cookie;
location.reload(true);
}
function handleClick(evnt) {
var targetstring = new String(evnt.target);
if (targetstring.search(adlink) != -1) {
writeCookie(0);
}
routeEvent(evnt);
return true;
}
if (window.Event) {
window.captureEvents(Event.CLICK);
}
window.onClick = handleClick;
adMessage('');
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<span onClick="writeCookie(0)">
<script language="javascript">
<!--
adMessage('<a href="http://www.evrsoft.com" target="_blank">Example Ad</a>');
// -->
</script>
</span>
<br>
<script language="javascript" TYPE="text/javascript">
if (showads) {
document.write("Remove the ad by clicking it.")
}
</script>
<!-- Optional To Show Ads Again -->
<script language="javascript" TYPE="text/javascript">
if (!showads) {
document.write("<form><input type=button value='Ads back' onClick=writeCookie(1)><\/form>")
}
</script>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL REMOVE ADS:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Adremover (adremover@portalen.no) -->
<!-- Web Site: http://adremover.vr9.com/ -->
<!-- Begin
// NB! You must manually change the value
// of the following adlink variable!
//
// Unique part of the ad link(s), i.e.,
// if the ad-link is www.myadvertiser.com,
// you can use "myadvertiser":
//
var adlink="change this text!";
//
// Time in seconds until the ads come back
// (default 24 hours):
//
var timeout=60*60*24;
// Do not change anything in the code below:
var showads = 1;
function adMessage(adcode) {
if (document.cookie == "") {
document.write(adcode);
} else {
var the_cookie = document.cookie;
the_cookie = unescape(the_cookie);
the_cookie_split = the_cookie.split(";");
for (loop=0;loop<the_cookie_split.length;loop++) {
var part_of_split = the_cookie_split[loop];
var find_name = part_of_split.indexOf("ad");
if (find_name!=-1) {
break;
}
}
if (find_name==-1) {
document.write(adcode);
} else {
var ad_split = part_of_split.split("=");
var last = ad_split[1];
if (last!=0) {
document.write(adcode);
} else {
showads=0;
}
}
}
}
function writeCookie(show) {
var today = new Date();
var the_date = new Date();
the_date.setTime(today.getTime() + 1000 * timeout);
var the_cookie_date = the_date.toGMTString();
var the_cookie = "ad="+show;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie = the_cookie;
location.reload(true);
}
function handleClick(evnt) {
var targetstring = new String(evnt.target);
if (targetstring.search(adlink) != -1) {
writeCookie(0);
}
routeEvent(evnt);
return true;
}
if (window.Event) {
window.captureEvents(Event.CLICK);
}
window.onClick = handleClick;
adMessage('');
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<span onClick="writeCookie(0)">
<script language="javascript">
<!--
adMessage('<a href="http://www.evrsoft.com" target="_blank">Example Ad</a>');
// -->
</script>
</span>
<br>
<script language="javascript" TYPE="text/javascript">
if (showads) {
document.write("Remove the ad by clicking it.")
}
</script>
<!-- Optional To Show Ads Again -->
<script language="javascript" TYPE="text/javascript">
if (!showads) {
document.write("<form><input type=button value='Ads back' onClick=writeCookie(1)><\/form>")
}
</script>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>